/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util.docsCache;

/**
 *
 * @author Boulat
 */

class DocPosition {
    private String file;
    private int docStartLine;
    private int docEndLine;

    DocPosition(String file, int docStartLine, int docEndLine) {
            this.file = file;
            this.docStartLine = docStartLine;
            this.docEndLine = docEndLine;
    }

    static DocPosition fromString(String str){
        String[] components = str.split("\\|");
        String file = components[0];
        int startLine = Integer.parseInt(components[1]);
        int endLine = Integer.parseInt(components[2]);
        return new DocPosition(file, startLine, endLine);
    }

    @Override
    public String toString() {
            return file+"|"+String.valueOf(docStartLine)+"|"+String.valueOf(docEndLine);
    }

    String getFile() {
            return file;
    }
    void setFile(String file) {
            this.file = file;
    }
    int getDocStartLine() {
            return docStartLine;
    }
    void setDocStartLine(int docStartLine) {
            this.docStartLine = docStartLine;
    }
    int getDocEndLine() {
            return docEndLine;
    }
    void setDocEndLine(int docEndLine) {
            this.docEndLine = docEndLine;
    }
}
